package com.cskaoyan.dbutils.resultsethandler;

import com.cskaoyan.connectionpool.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;

public class ScalarHandlerDemo {

    public static void main(String[] args) throws SQLException {


        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Long query = queryRunner.query("select count(*) from city", new ScalarHandler<Long>());

        System.out.println(query);
    }
}
